package com.example.homework.homework01;


// 存钱线程类
public class depositThread extends Thread {
    private Account account; // 记住线程对象要处理的账户对象

    public depositThread(String name, Account account) {
        super(name); // 调用父类构造器初始化线程名称
        this.account = account;
    }

    @Override
    public void run() {
        // 循环10次
        for (int i = 0; i < 10; i++) {
            // 存钱
            account.deposit(100);
        }
    }
}
